﻿/// <reference path="../server.js" />
/// <reference path="../Utills.js" />
/// <reference path="../Class.js" />
/// <reference path="../MenuViewModel.js" />
/// <reference path="knockout-2.2.1.js" />

describe("TestMenuViewMode", function () {
    utills.storegeObjectShim();
    //utills.prototypalOOP();
    // load menu data
    var menuData = server.getMenu();
    var ordersHistory = server.getOrdersHistory();
    var viewModel = new MenuViewModel(menuData, ordersHistory);
   beforeEach(function () {
       server.clearHistory();
    });
	
   it("TestSaveLoadOrderItem", function () {       
       viewModel.addOrderItem(30001, 3);
       var loadedOrderItem = viewModel.getOrderData();       
       expect(loadedOrderItem.data[0].id).toEqual(30001);
   });

   it("TestClearOrder", function () {       
       viewModel.addOrderItem(30001, 3);
       viewModel.clearOrder();
       var loadedOrderItem = viewModel.getOrderData();
       expect(loadedOrderItem.data[0]).toEqual(undefined);
   });
});